package com.woniuxy.lifeorder.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author 陈瑜洲，吴继明
 * @since 2020-09-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("BUS_ORDER")
@ApiModel(value="BusOrder对象", description="订单表")
@KeySequence("BO_BUS_ORDER")
public class BusOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单号")
    @TableId(value = "ORDER_ID",type = IdType.INPUT)
    private Integer orderId;

    @ApiModelProperty(value = "订单表序号")
    @TableField("ORDER_NUMBER")
    private String orderNumber;

    @ApiModelProperty(value = "支付交易号")
    @TableField("PAY_NUMBER")
    private String payNumber;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "订单更新时间")
    @TableField("UPDATE_TIME")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "支付时间")
    @TableField("PAY_TIME")
    private LocalDateTime payTime;

    @ApiModelProperty(value = "成交时间")
    @TableField("FINISH_TIME")
    private LocalDateTime finishTime;

    @ApiModelProperty(value = "订单状态,0:未支付、1：已支付、2：已失效、3：退款中、4:已退款、5:已完成")
    @TableField("ORDER_STATUS")
    private Integer orderStatus;

    @ApiModelProperty(value = "用户编号")
    @TableField("USER_ID")
    private String userId;
    @ApiModelProperty(value = "用户对象")
    @TableField(exist = false)
    private User user;

    @ApiModelProperty(value = "卖家编号")
    @TableField("OUTUSER_ID")
    private String outuserId;
    @ApiModelProperty(value = "卖家对象")
    @TableField(exist = false)
    private User outuser;

    @ApiModelProperty(value = "订单类型编号")
    @TableField("ORDER_TYPE_ID")
    private Integer orderTypeId;

    @ApiModelProperty(value = "优惠券编号")
    @TableField("COUPON_ID")
    private Integer couponId;

    @ApiModelProperty(value = "订单总金额")
    @TableField("TOTAL_AMOUNT")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "实际支付金额")
    @TableField("PAY_AMOUNT")
    private BigDecimal payAmount;

    @ApiModelProperty(value = "优惠券抵扣金额")
    @TableField("COUPON_AMOUNT")
    private BigDecimal couponAmount;

    @ApiModelProperty(value = "软删除")
    @TableField("FLAG")
    private Integer flag;

    @ApiModelProperty(value = "订单类型对象")
    @TableField(exist = false)//执行SQL时 忽略该属性
    private Ordertype ordertype;
}
